<template>
  <cssModal :visible="visible" :title="title" @cancelModal="close">
    <div class="componyInfo">
      <p>Please confirm your headhunting company</p>
      <p><i class="iconfont icon-yongrendanwei"></i>您的公司：{{company}}</p>
    </div>
    <div class="control">
      <p v-if="companies.length > 0">系统找到如下名称类似公司，请确认是加入已有企业，还是注册新的猎头企业:</p>
      <!-- <p>北京世纪互联人才服务有限公司 <a-button type="primary">申请加入  Apply to join</a-button></p> -->
      <p v-for="item in companies" :key="item.id">{{item.name}} <a-button type="primary" @click="cancelModal('', {selectEnterpriseId: item.id, name: item.corpName})">申请加入  Apply to join</a-button></p>
      <p>{{`${companies.length > 0?'以上均不是我的企业': '暂未找到同名公司，请注册新的猎头企业'}`}}  <a-button type="primary" @click="cancelModal('showOpen')">开通新的猎头企业  Open a new</a-button></p>
    </div>
  </cssModal>
</template>

<script>
import cssModal from '@/components/Common/cssModal'
export default {
  name: 'AddEnterprises',
  props: ['visible', 'title', 'companies', 'company'],
  components: { cssModal },
  data () {
    return {
    }
  },
  computed: {
  },
  methods: {
    cancelModal (type, data) {
      this.$emit('cancelModal', { type, ...data })
    },
    close () {
      this.$emit('close')
    }
  }
}
</script>

<style lang="stylus" scoped>
@import '../../styles/var.styl'
.componyInfo
  line-height 28px
  padding 24px
  border-bottom 1px solid borderColor
  >p
    text-align center
    font-size 12pt
    color registBlue
.control
  text-align right
  line-height 48px
  padding 24px
  button
    background btnBlue
    border-radius 30px
    line-height 38px
    height 40px
    margin-left 12px
    border none
</style>
